package com.example.administrator.familfinalcialmanagement.util.dialog;

import android.content.Context;
import android.databinding.DataBindingUtil;
import android.view.LayoutInflater;
import android.view.View;

import com.example.administrator.familfinalcialmanagement.R;
import com.example.administrator.familfinalcialmanagement.databinding.DialogInCommonBinding;
import com.example.administrator.familfinalcialmanagement.databinding.DialogRegisterBinding;
import com.example.administrator.familfinalcialmanagement.util.listener.OnBHClickListener;

/**
 * Created by 86178 on 2019/12/3.
 * author mogen
 * 用心，成就一切。
 */
public class RegisterDialog extends BaseDialog {

    Context context;
    DialogRegisterBinding inComminBinding ;
    OnBHClickListener onBHClickListener;

    public RegisterDialog(Context context) {
        super(context);
        this.context = context;
        inComminBinding = DataBindingUtil.inflate( LayoutInflater.from(context), R.layout.dialog_register,null,false);
        inComminBinding.setDialog(this);
        setContentView(inComminBinding.getRoot());
    }

    public void setOnBHClickListener(OnBHClickListener onBHClickListener) {
        this.onBHClickListener = onBHClickListener;
    }

    public void noPoint(View view){
        if (onBHClickListener != null) {
            onBHClickListener.onCloseClick();
        }
        dismiss();
    }

    public void okPoint(View view){
        if (onBHClickListener != null) {
            onBHClickListener.onConfirmClick();
        }
        dismiss();
    }

    //设置标题的颜色
    public void setTitleText(String str){
        inComminBinding.dialogRemind.setText(str);
    }

    public void setTitleText(String str,String leftStr,String rightStr){
        inComminBinding.dialogRemind.setText(str);
        inComminBinding.dialogNo.setText( leftStr );
        inComminBinding.dialogYes.setText( rightStr );
    }

}

